const seqArr = [44, 42, 43, 44, 44, 42, 43, 44]

function fibonacci (n) {
  return n === 0
    ? 0
    : n === 1
      ? 1
      : fibonacci(n - 1) + fibonacci(n - 2)
}

function calculate (seq, taskId) {
  return new Promise((resolve, reject) => {
    console.log(`Task ${taskId} starts calculating.`)
    const start = Date.now()
    const result = fibonacci(seq)
    console.log(`The result of task ${taskId} is ${result}, taking ${Date.now() - start} ms.`)
    return resolve(result)
  })
}

;(async function main () {
  console.time('main')
  const results = await Promise.all(seqArr.map(calculate))
  results.forEach((result, index) => console.log(`Task ${index}'s result is ${result}`))
  console.timeEnd('main')
})()